package com.wiwl.dao.hibernate;

import java.util.List;

import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.wiwl.dao.interfaces.IMenuItemDAO;
import com.wiwl.web.controller.MenuItem;

@Repository
public class MenuItemDAO extends GenericHibernateDAO<MenuItem> implements
		IMenuItemDAO {

	@Autowired
	public MenuItemDAO(SessionFactory sf) {
		super(sf);
	}
	
	@Override
	public List<MenuItem> getRootMenuItems() {
		return findByCriterion(Restrictions.isNull("parentMenuItem"));
	}
}
